package com.tanhua.server.config;

import com.tanhua.commons.utils.Constants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.ParseException;

@Component
public class RedisConfig {

    @Autowired
    private RedisTemplate redisTemplate;

    /**
     * 配置时间规则
     * 在学习测试时，可以将时间间隔设置相对短一些
     */
    @Scheduled(cron = "0 0 0  ? * *")
    public void analysis() throws ParseException {
        System.out.println("定时任务开始执行了!!!!!");
        redisTemplate.delete("SOUND");
    }
}